package com.ruoyi.project.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.SysIntegralMapper;
import com.ruoyi.project.system.domain.SysIntegral;
import com.ruoyi.project.system.service.ISysIntegralService;

/**
 * 积分明细Service业务层处理
 * 
 * @author jjp
 * @date 2020-04-27
 */
@Service
public class SysIntegralServiceImpl implements ISysIntegralService 
{
    @Autowired
    private SysIntegralMapper sysIntegralMapper;

    /**
     * 查询积分明细
     * 
     * @param integralId 积分明细ID
     * @return 积分明细
     */
    @Override
    public SysIntegral selectSysIntegralById(Long integralId)
    {
        return sysIntegralMapper.selectSysIntegralById(integralId);
    }

    /**
     * 查询积分明细列表
     * 
     * @param sysIntegral 积分明细
     * @return 积分明细
     */
    @Override
    public List<SysIntegral> selectSysIntegralList(SysIntegral sysIntegral)
    {
        return sysIntegralMapper.selectSysIntegralList(sysIntegral);
    }

    /**
     * 新增积分明细
     * 
     * @param sysIntegral 积分明细
     * @return 结果
     */
    @Override
    public int insertSysIntegral(SysIntegral sysIntegral)
    {
        sysIntegral.setCreateTime(DateUtils.getNowDate());
        return sysIntegralMapper.insertSysIntegral(sysIntegral);
    }

    /**
     * 修改积分明细
     * 
     * @param sysIntegral 积分明细
     * @return 结果
     */
    @Override
    public int updateSysIntegral(SysIntegral sysIntegral)
    {
        return sysIntegralMapper.updateSysIntegral(sysIntegral);
    }

    /**
     * 批量删除积分明细
     * 
     * @param integralIds 需要删除的积分明细ID
     * @return 结果
     */
    @Override
    public int deleteSysIntegralByIds(Long[] integralIds)
    {
        return sysIntegralMapper.deleteSysIntegralByIds(integralIds);
    }

    /**
     * 删除积分明细信息
     * 
     * @param integralId 积分明细ID
     * @return 结果
     */
    @Override
    public int deleteSysIntegralById(Long integralId)
    {
        return sysIntegralMapper.deleteSysIntegralById(integralId);
    }
}
